/***************************************************************
*Copyright(c) 2020思特诺(Stduino)All right reserved.
*
*This library is open source and free for individual users. 
*
*For commercial use, please contact service001@stduino.com.
***************************************************************/

#ifndef StduinoCharacter_h
#define	StduinoCharacter_h

#include <ctype.h>

inline bool isAlphaNumeric(int c) 		__attribute__((always_inline));
inline bool isAlpha(int c) 				__attribute__((always_inline));
inline bool isAscii(int c) 				__attribute__((always_inline));
inline bool isWhitespace(int c)			__attribute__((always_inline));
inline bool isControl(int c) 			__attribute__((always_inline));
inline bool isDigit(int c) 				__attribute__((always_inline));
inline bool isGraph(int c)				__attribute__((always_inline));
inline bool isLowerCase(int c) 			__attribute__((always_inline));
inline bool isPrintable(int c) 			__attribute__((always_inline));
inline bool isPunct(int c) 				__attribute__((always_inline));
inline bool isSpace(int c) 				__attribute__((always_inline));
inline bool isUpperCase(int c) 			__attribute__((always_inline));
inline bool isHexadecimalDigit(int c) 	__attribute__((always_inline));
inline int 	toAscii(int c) 				__attribute__((always_inline));
inline int 	toLowerCase(int c)		 	__attribute__((always_inline));
inline int 	toUpperCase(int c) 			__attribute__((always_inline));

inline boolean isAlphaNumeric(int c) 
{
  return ( isalnum(c) == 0 ? false : true);
}

inline boolean isAlpha(int c)
{
  return ( isalpha(c) == 0 ? false : true);
}

inline boolean isAscii(int c)
{
  return ( isascii (c) == 0 ? false : true);
}

inline boolean isWhitespace(int c)
{
  return ( isblank (c) == 0 ? false : true);
}

inline boolean isControl(int c)
{
  return ( iscntrl (c) == 0 ? false : true);
}

inline boolean isDigit(int c)
{
  return ( isdigit (c) == 0 ? false : true);
}

inline boolean isGraph(int c)
{
  return ( isgraph (c) == 0 ? false : true);
}

inline boolean isLowerCase(int c)
{
  return (islower (c) == 0 ? false : true);
}

inline boolean isPrintable(int c)
{
  return ( isprint (c) == 0 ? false : true);
}

inline boolean isPunct(int c)
{
  return ( ispunct (c) == 0 ? false : true);
}

inline boolean isSpace(int c)
{
  return ( isspace (c) == 0 ? false : true);
}

inline boolean isUpperCase(int c)
{
  return ( isupper (c) == 0 ? false : true);
}

inline boolean isHexadecimalDigit(int c)
{
  return ( isxdigit (c) == 0 ? false : true);
}

inline int toAscii(int c)
{
  return toascii (c);
}

inline int toLowerCase(int c)
{
  return tolower (c);
}

inline int toUpperCase(int c)
{
  return toupper (c);
}

#endif

/***************************************************************
*Copyright(c) 2020思特诺(Stduino)All right reserved.
*
*This library is open source and free for individual users. 
*
*For commercial use, please contact service001@stduino.com.
***************************************************************/
